package com.archives.blog.web.erp;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.archives.blog.common.domain.entity.Admin;
import com.archives.blog.common.domain.pojo.request.AdminQueryRequest;
import com.archives.blog.manager.AdminManager;
import com.archives.blog.web.BaseSupportController;

/**
 * 管理员管理
 * 
 * @author chh
 *
 */
@Controller
@RequestMapping("/erp/admin")
public class ERPAdminController extends BaseSupportController{
	
	/** 日志管理*/
	private static Logger logger = LoggerFactory.getLogger(ERPAdminController.class);

	/** 管理员管理*/
	@Autowired
	private AdminManager adminManager;

	/**
	 * 管理员查询
	 * 
	 * @param request
	 * @return
	 */
	@RequestMapping("/query")
	@ResponseBody
	public Page<Admin> query(@RequestBody AdminQueryRequest request){
		Page<Admin> page = null;
		try {
			page = adminManager.getPage(request);
		} catch (Exception e) {
			logger.error("管理员查询异常", e);
		}
		return page;
	}
}
